#pragma once
#include "MobileTile.h"
#include "FixedTile.h"
#include "Tile.h"
//#include "GridIterator.h"
namespace Model{
	class Grid
	{
	private:
		//TODO add the relation towards Tiles

		void pushBackRow(MobileTile* t,int row);
		void pushFrontRow(MobileTile* t, int row);
		void pushBackColumn(MobileTile* t, int column);
		void pushFrontColumn(MobileTile* t, int column);
		friend class GridIterator;
	public:
		void pushTile(MobileTile* t, int row,int column);
		Grid(void);
		~Grid(void);
		void newPosOfIfPush(int row,int column, int *x,int *y);
		Grid* clone();
		GridIterator* getIterator();
		class GridIterator
		{
		private:
			Grid* myGrid;
			Tile* ec;
		public:
			void up();
			void down();
			void left();
			void right();
			Tile getEc();
			void init();
			void endRow();
			void beginRow();
			void endColumn();
			void beginColumn();
			bool outOfBounds();
			GridIterator(Grid* g);
			~GridIterator(void);
		};
	};
}